#include <REGX52.H>
#include <Delay.H>
#include "MatrixLED.h"

// 将数组放在flash的存储里面，但不能随意更改
// 没加code的关键字的话，会放在内存(就是在ram中)。 
unsigned char code Animation[] = {
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0xFF,0x08,0x08,0xFF,0x00,0x0E,0x15,0x15,
	0x15,0x08,0x00,0xFE,0x01,0x02,0x00,0xFE,
	0x01,0x02,0x00,0x0E,0x11,0x11,0x0E,0x00,
	0xFD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

void main()
{
	unsigned char i,offset=3,Count=0;
	MatrixLed_Init();
	while(1)
	{
		for(i=0;i<8;i++) {
			MatrixLed_showColumn(i,Animation[i+offset]);
		}
		Count++;
		if(Count>10)
		{
			Count=0;
			offset++;
			if(offset>40)
			{
				offset=0;
			}
		}
		
	}
	
}